# -*- coding: utf-8 -*-
# coding:utf-8

import random
from django import template

__author__ = 'lancelrq'

register = template.Library()


@register.filter(name='random_num')
def random_num(value, arg=None):
    try:
        return random.randint(int(value), int(arg))
    except:
        return 0
